<?php
// replace with HTML entities
// output: '&lt;div width=&quot;200&quot;&gt;
//          This is a div&lt;/div&gt;'
  $abc = "<script>alert('hello')</script>";
  //echo $abc = "Hello : &lt;script&gt;alert('hello')&lt;/script&gt;";

echo htmlentities($abc);
echo $html = '<div style="border:1px solid red" width="200">This is a div</div>';
echo htmlentities($html);
echo "<br>";
// replace line breaks with <br/>s
// output: 'This is a bro<br />
//            ken line'
echo $lines = 'H-231 Second Floor
               Sector 67, Noida
               Up(201301)
               India';
echo "<br>";
echo nl2br($lines);
